#ifndef COMMON_COLOR_H
#define COMMON_COLOR_H

#include <cstdint>
#include <functional>

class Color
{
public:
    uint8_t r;
    uint8_t g;
    uint8_t b;
    uint8_t a;
    Color(uint8_t r_, uint8_t g_, uint8_t b_, uint8_t a_) : r(r_), g(g_), b(b_), a(a_) { }
    bool operator== (const Color& other) const;
};

template<>
struct std::hash<Color>
{
    inline size_t operator() (const Color& o) const
    {
        return o.r ^ o.g ^ o.b ^ o.a;
    }
};

inline bool Color::operator==(const Color &other) const
{
    return r == other.r && g == other.g && b == other.b && a == other.a;
}

#endif //COMMON_COLOR_H
